<?php

class InboxWidget extends CWidget {

    public $title = 'User login';
    public $visible = true;
    public $array = array();
    public $model;

    public function init() {
        if ($this->visible) {
			$this->renderContent();  
        }
    }
    protected function renderContent() {
        $this->model = Inbox::model()->findAll(array('condition'=>'user_id=:id','order'=>'id DESC','limit'=>3,'params'=>array(':id'=>Yii::app()->user->id)));
        $this->render('ViewInbox',array('model'=>$this->model));
    }

}

?>
